<!--
 * @Description: 流程引擎iframe
 * @Author 卞鹏飞 <228443632@qq.com>
 * @create 23/11/24 PM1:05
 -->
<!--setup-->
<script setup lang="ts">
import { onMounted, getCurrentInstance, ref, type ComponentInternalInstance, computed } from 'vue'
import MicroIframe from '../biz-micro-iframe/index.vue'
import profile from '@root/profile.ts'
import { propsInfo } from '@/components/biz-micro-iframe/types.ts'
import { omit } from 'sf-utils2'
import { isNullOrEmptyString } from '@shared/utils/common'

const { proxy } = getCurrentInstance() as ComponentInternalInstance

const props = defineProps({
  ...propsInfo
})
const emit = defineEmits({})

/* 状态 */
const entryBasePrefix = profile.cfWorkflowAddress + `/#/authorization/cf-manage`
const microIframeRef = ref<InstanceType<typeof MicroIframe>>()

/* 方法 */

/**
 * 排除null、undefined
 */
const _excludeNullProps = computed(() => {
  return omit(props, isNullOrEmptyString)
})

/* 计算 */

/* 监听 */

/* 周期 */
onMounted(() => {})

/* 暴露 */
defineExpose({
  $: proxy.$,
  microIframeRef
})
</script>

<!--render-->
<template>
  <MicroIframe
    v-bind="_excludeNullProps"
    ref="microIframe"
    :entryBasePrefix="entryBasePrefix"
  />
</template>

<!--style-->
<style scoped lang="less"></style>
